package com.cisdi.blog.dao;

import com.cisdi.blog.entity.Type;
import com.cisdi.blog.entity.User;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 类型
 * @author pengyangyan
 * @version 1.0.0
 * @date 2020年03月18日 09:44:00
 */
@Repository
public interface TypeRepository extends JpaRepository<Type,Long> {

    Type findTypeByName(String name);

    @Query("select t from Type t")
    List<Type> findTop(Pageable pageable);
}
